/**
*      author: Y_Yao
*      created: 2024-11-15 22:51:24
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int a1,a2,a3,a4;
    int a[4];
    unordered_map<int,int> hash;
    for(int i = 1;i <= 4;i++)
    {
        cin >> a[i];
        hash[a[i]]++;
    }
    int ret = 0;
    for(int i = 1;i <= 4;i++)
    {
        if(hash.count(a[i]) && hash[a[i]] >= 2)
        {
            ret += hash[a[i]] / 2;
            hash.erase(a[i]);
        }
    }

    cout << ret << endl;

    return 0;
}